<?php
// Define a reference file path
$ref_dir = "/samples/";

// Default request is class manual
if (!empty($_GET['file'])) {
  $ref_file = $_GET['file'];
  $ref_file_path = dirname(__FILE__) . $ref_dir . $ref_file . ".php";
} else {
  die("INVALID REQUEST");
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpManta - Mdoc - View source code</title>
</head>

<body>
<h1>View source code (<?php echo $ref_file; ?>)</h1>
<?php 
  // Display formatted source code
  highlight_file($ref_file_path);
?>
</body>
</html>
